<{include file="../common/iframe_header.tpl"}>
<link href="/css/uploadify.css" rel="stylesheet">
<div class="pad_10" style="margin-top: 40px;">
    <div class="table-list">
        <div class="common-form">
            <input type="file" name="upfile" id="uploadify"/>
            <div>请选择ZIP,RAR文件包</div>
        </form>
        </div>
    </div>
    <br/>
    <div class="table-list">
        <table width="100%">
        <thead>
            <tr>
                    <th>ZIP文件名</th>
                    <th>上传时间</th>
                    <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <{foreach $list as $key => $val}>
            <tr onMouseOver="this.className = 'tr2'" onMouseOut="this.className = 'tr1'" class="tr1" id="question_<{$val.network_id}>">
                    <td><{$val.zip_name}></td>
                    <td><{$val.create_time|date_format:'%Y-%m-%d'}></td>
                    <td><a onclick="del(<{$val.na_id}>)">删除</a></td>
            </tr>
            <{/foreach}>
        </tbody>
        </table>

        <div style="float:right;"><{$page}></div>
    </DIV>
</div>

   
<script src="/js/jquery.uploadify.min.js"></script>
<script type="text/javascript">
    $('#uploadify').uploadify({
        //'debug': true,
        'formData'      : {'network_id' : '<{$network_id}>'},
        'buttonText' : '请选择ZIP文件',
        'fileObjName' : 'upfile',   
        'swf'      : '/js/uploadify.swf',
        'fileTypeExts' : '*.zip;*.rar',
        'uploader' : '/webadmin/attach/NetworkZip',
        'onUploadSuccess' : function(file, data, response) {
            var obj = eval('(' + data + ')');
            if (obj.state =='SUCCESS'){
                alert('上传成功');
                window.location.reload();
            } else {
                alert(obj.error);
            }
        } 
    });
    //删除附件
    function del(na_id){
        if (confirm('确定删除此附件？')) {
            $.getJSON('/webadmin/network/DelAttach',{na_id:na_id},function(res){
                alert(res.note);
                if (res.status == 1) {
                    window.location.reload();
                }
            });
        }
    }
</script>
<{include file="../common/footer.tpl"}>